
Last chance! 50% off unlimited learning
Sale ends in
Convert bn
and bn.fit
objects to igraph
and vice versa.
# S3 method for igraph
as.bn(x, ..., check.cycles = TRUE)
# S3 method for bn
as.igraph(x, ...)
# S3 method for bn.fit
as.igraph(x, ...)
An object of the relevant class.
an object of class bn
, bn.fit
, or igraph
.
extra arguments from the generic method (currently ignored).
a boolean value. If FALSE
the returned network will
not be checked for cycles.
Marco Scutari
if (FALSE) {
a = bn.fit(hc(learning.test), learning.test)
b = as.igraph(a)
plot(b, edge.arrow.mode = 2L * !igraph::which_mutual(b))
c = as.bn(b)}
Run the code above in your browser using DataLab